//
//  CXStatusListViewModel.swift
//  XinaWeibo
//
//  Created by chenxuan on 2017/4/11.
//  Copyright © 2017年 chenxuan. All rights reserved.
//

import Foundation
import YYModel

class CXStatusListViewModel {
    
    lazy var statusList = [CXStatus]()
    
    func loadStatus(completion: @escaping (_ isSuccess: Bool)->()) {
        CXNetworkManager.shared.statusList { (json, isSuccess) in
            guard let array = NSArray.yy_modelArray(with: CXStatus.self, json: json ?? []) as? [CXStatus] else{
                completion(isSuccess)
                return
            }
            
            self.statusList += array
            completion(isSuccess)
        }
    
    
    }
    
    
    
}
